import request from '@/utils/request'

// 创建退/换货
export function createBack(data) {
  return request({
    url: '/qd/back/create',
    method: 'post',
    data: data
  })
}

// 更新退/换货
export function updateBack(data) {
  return request({
    url: '/qd/back/update',
    method: 'put',
    data: data
  })
}

// 删除退/换货
export function deleteBack(id) {
  return request({
    url: '/qd/back/delete?id=' + id,
    method: 'delete'
  })
}

// 获得退/换货
export function getBack(id) {
  return request({
    url: '/qd/back/get?id=' + id,
    method: 'get'
  })
}

// 获得退/换货分页
export function getBackPage(query) {
  return request({
    url: '/qd/back/page',
    method: 'get',
    params: query
  })
}

// 导出退/换货 Excel
export function exportBackExcel(query) {
  return request({
    url: '/qd/back/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
